import java.util.Scanner;
public class test{
    public static void main(String [] age){
        int a;
        Scanner sc=new Scanner(System.in);
        a=sc.nextInt();
        System.out.println(a%10);
    }
}
